/**
 * Copyright (c) 2009-2010 李冬生(Domsn Lee)
 * Jul 1, 2009 11:24:37 PM  
 * Email: 8971092@qq.com
 * QQ: 8971092
 * All rights reserved
 * 转载请注明版权信息
 */
package com.langsin.crmpro.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Domsn
 *
 */
public class DTool
{
	private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
	
	public static String date2Str(Date _date,String _pattern)
	{
		String $returnStr = "";
		try
		{
			if( _pattern != null && !"".equals(_pattern))
				sdf.applyPattern(_pattern);
			$returnStr = sdf.format(_date);
		}
		catch(Exception e)
		{
			$returnStr = "您传入的日期格式有误";
		}
		
		return $returnStr;
	}
	
	public static void main(String [] args)
	{
		String date = DTool.date2Str(new Date(), "");
		
		System.out.println(date);
	}
	
	

}
